package testenum;

import lombok.AllArgsConstructor;
import lombok.Getter;

public enum ResultEnum {
    //创建方法，调用构造方法初始化参数
    SUCCESS(0,"成功"),
    EROOR(-1,"失败");

   //定义参数
    private Integer code;
    private String desc;

    //定义构造方法初始化参数
    ResultEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    //获取参数
    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
